package 异常处理;

public class Demo7 {
    public static void a(int a) throws Demo6{
        if (a>10){
            throw new Demo6("a不能大于10");
        }
    }

    public static void main(String[] args) {
        try {
            a(12);
        } catch (Demo6 e) {
            System.out.println(e.getMessage());
        }
    }
}
